import 'package:flutter/material.dart';
import '../../utils/base.dart';

import '../../widgets/table.dart';

class RiskCoinBean{

  final int type;

  final String nickname;

  final String memberId;

  final String deviceSn;

  final int amount;

  final String time;

  final int status;

  RiskCoinBean({this.type, this.nickname, this.memberId, this.deviceSn, this.amount, this.status, this.time});
}

class RiskCoinList extends StatelessWidget {
  const RiskCoinList({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: XTable(
        columns: [
          '异常类型',
          '操作会员',
          '设备编号',
          '数量',
          '发生异常时间',
          '处理状态'
        ],
        data: [
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
          RiskCoinBean(type: 1, nickname: '面包', memberId: '123123', deviceSn: 'TEST083', amount: 123123, time: '2019-08-12 12:00:00', status: 1),
        ].map((b)=>
          <XTableCell>[
            XTableCell(data: '异常上分', type: XTableCellType.text),
            XTableCell(data: '${b.nickname}(${b.memberId})', type: XTableCellType.text),
            XTableCell(data: b.deviceSn, type: XTableCellType.text),
            XTableCell(data: '${b.amount}分', type: XTableCellType.text),
            XTableCell(data: b.time, type: XTableCellType.text),
            XTableCell(data: '${b.status}', type: XTableCellType.button),
        ]
        ).toList(),
      ),
    );
  }
}
